package us.icitap.timsportal.util;

import com.vaadin.ui.Window;
import com.vaadin.ui.Window.Notification;

public class PortalNotification {
	
	public static void showWarning(String msg, Window window){
		window.showNotification(msg, Notification.TYPE_WARNING_MESSAGE);
	}
	
//	public static void showWarning(String msg,String desc, Window window){
//		window.showNotification(msg, desc, Notification.TYPE_WARNING_MESSAGE, true);
//	}

	public static void showWarning(String msg,String desc, Window window, boolean onTop){
		Window.Notification n = new Window.Notification(msg, desc, Notification.TYPE_WARNING_MESSAGE);
		if(onTop)
			n.setDelayMsec(-1);
		window.showNotification(n);
	}
	
	public static void showError(String msg, Window window){
		window.showNotification(msg, Notification.TYPE_ERROR_MESSAGE);
	}
	
	public static void showTrayMessage(String msg, Window window){
		Window.Notification n = new Window.Notification(msg, Notification.TYPE_TRAY_NOTIFICATION);
		n.setDelayMsec(-1);
		window.showNotification(n);
	}
	
	public static void showHumanizedMessage(String msg, Window window){
		window.showNotification(msg, Notification.TYPE_HUMANIZED_MESSAGE);
	}

}
